﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace Wangzeran.CodeMaker.Core.DB
{
    /// <summary>
    /// 标签插件集合
    /// </summary>
    public class DBPlugIns
    {
        /// <summary>
        /// 已注册标签
        /// </summary>
        private static IDictionary<string, IDBPlugInSupport> m_Dbs 
                            = new Dictionary<string, IDBPlugInSupport>();
        /// <summary>
        /// 已注册标签
        /// </summary>
        public static IDictionary<string, IDBPlugInSupport> Dbs
        {
            get { return m_Dbs; }
            set { m_Dbs = value; }
        }

        /// <summary>
        /// 注册标签
        /// </summary>
        /// <param name="tag">标签实例</param>
        public static void RegisterDatabase(IDBPlugInSupport plugin)
        {
            try
            {
                m_Dbs.Add(plugin.DatabaseType, plugin);
            }
            catch (Exception ex)
            {	
                throw ex;
            }
        }
    }
}
